//
//  UITextField+KR.m
//  KEREN
//
//  Created by MW on 2023/4/23.
//

#import "UITextField+KR.h"

@implementation UITextField (KR)

+ (UITextField *)setFlieldplaceholder:(NSString *)placeholder Font:(UIFont *)font borderColor:(UIColor *)color{
    UITextField *textField = [[UITextField alloc] init];
    textField.layer.cornerRadius = 25;
    textField.clipsToBounds = YES;
    if(color != [UIColor clearColor]){
        textField.layer.borderColor = color.CGColor;
        textField.layer.borderWidth = 1;
    }
    //TODO 国际化
    textField.placeholder = placeholder;
    textField.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 16, 0)];
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.rightView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 16, 0)];
    textField.rightViewMode = UITextFieldViewModeAlways;
    textField.font = font;
    return textField;
}

@end
